# 将文件里面的每一行去除空白后拼接在一起,类似与:
# 3.141592653589793238462643383279
from pathlib import Path

path = Path('pi.txt')
content = path.read_text()

lines = content.splitlines()
pi = ''
for line in lines:
    pi += line.strip()

print(pi)